@extends('common')
@section('content')
<style type="text/css">
	span{
		margin-left: 5%;
	}
	select{
		width: 13%;
	}
	input{
		width: 10%;
	}
	td{
		text-align: center;
	}

</style>
<form class="form-inline definewidth m20" action="{{url('/coach/xue')}}" method="get">
<table class="table table-bordered table-hover definewidth m10" style="background:silver;">
<tr>
	<td>
		<span>学员编号：<input type="text" name="use_num" placeholder="如：XY20161001"></span>
		<span>姓名：<input type="text" name="use_name" pattern="^[\u4e00-\u9fa5]{2,17}$" placeholder="如：张三"></span>
		<span>最后上课时间：
		<input type="text" name="stu_endtime" id="indate1">
		</span>
		<span>报名时间：
		<input type="text" name="use_enty" id="indate2">
		</span>
	</td>
</tr>
<tr>		
	<td>
	   <span>学习阶段：
	   <select name="suj_id" >
	   <option value="">--请选择--</option>
	   @foreach($sub_info as $v)
	    <option value="{{$v['sub_id']}}">{{$v['sub_name']}}</option>
	   @endforeach
	   </select>
	   </span>
	   <span>车型:
	   <select name="per_id" >
	   <option value="">--请选择--</option>
	   @foreach($pap_info as $v)
        <option value="{{$v['pap_id']}}">{{$v['pap_name']}}</option>
	   @endforeach
	   </select>
	   </span>
	   <span>状态：
	   <select name="stu_state" >
	   <option value="">--请选择--</option>
	   @foreach($query as $v)
	   <option value="{{$v['ust_id']}}">{{$v['ust_state']}}</option>
	   @endforeach
	   </select></span>
	   <span>
	   <button type="button" id="search" class="btn btn-primary">查找</button>
	   <button type="submit" class="btn btn-primary">导出</button>
	   </span>	
	</td>
</tr>		
</table>
</form>
<br>
<table style="background:silver;margin-left:4%;" bgcolor="silver" border="1" bordercolordark="darkseagreen" >
	<tr>
		<td width="5%">序号</td>
		<td width="5%">编号</td>
		<td width="5%">姓名</td>
		<td width="5%">性别</td>
		<td width="5%">身份证号</td>
		<td width="5%">手机号码</td>
		<td width="5%">车型</td>
		<td width="5%">学习阶段</td>
		<td width="5%">报名时间</td>
		<td width="5%">状态</td>
	</tr>
</table>
<div id="tab">
<table style="margin-left:4%;" class="table table-bordered table-hover definewidth m10">
	<tr>
		<td>序号</td>
		<td>编号</td>
		<td>姓名</td>
		<td>性别</td>
		<td>身份证号</td>
		<td>手机号</td>
		<td>车型</td>
		<td>学习阶段</td>
		<td>阶段课时</td>
		<td>最后上课日期</td>
		<td>报名时间</td>
		<td>状态</td>
	</tr>
	@foreach($model as $k=>$v)
	<tr>
		<td>{{$k+1}}</td>
		<td>{{$v->use_num}}</td>
		<td>{{$v->use_name}}</td>
		<td>
		 @if($v->use_sex==1){{'男'}}@else{{'女'}}@endif
		</td>
		<td>{{$v->use_card}}</td>
		<td>{{$v->use_phone}}</td>
		<td>{{$v->pap_name}}</td>
		<td>{{$v->sub_name}}</td>
		<td>{{$v->stu_time}}</td>
		<td>{{$v->stu_endtime}}</td>
		<td>{{$v->use_enty}}</td>
		<td>{{$v->ust_state}}</td>
	</tr>
	@endforeach
</table>
</div>

    <script src="{{url('api/jedate/jedate.js')}}"></script>
    <script type="text/javascript">
    	jeDate({
            dateCell:"#indate1",
            format:"YYYY-MM-DD",
            isinitVal:false,
            isTime:true, //isClear:false,
            minDate:"2000-01-01",
            okfun:function(val){alert(val)}
        })
        jeDate({
            dateCell:"#indate2",
            format:"YYYY-MM-DD",
            isinitVal:false,
            isTime:true, //isClear:false,
            minDate:"2000-01-01",
            okfun:function(val){alert(val)}
        })
        $(document).ready(function(){
            $("#search").click(function(){
                var url="{{ url('/coach/xue') }}";
                $.get(url,$('form').serialize(),
                        function(data){
                            $("#tab").html(data);
                        });
            });
        });
    </script>



@stop